﻿@model Model.Laboratory.E_tb_Project
@{
    ViewBag.Title = "ProjectEdit";
}

<!DOCTYPE html>

<head>
    <meta name="viewport" content="width=device-width" />
    <title>项目信息</title>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/default/easyui.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/icon.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/demo.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/uploader/uploadify.css")' />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/Validform/style.css")'  />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Content/XINDECSS/MainStyle.css")'/>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-1.8.2.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/jquery.easyui.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/jquery.uploadify.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/swfobject.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftMvcAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/Validform/Validform_v5.3.2_min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/My97DatePicker/WdatePicker.js")'></script>

</head>
<body>
        @using (Ajax.BeginForm("Save", "Project", new AjaxOptions { HttpMethod = "Post", OnSuccess = "handle", OnFailure = "failed" }, new { @id = "frmUpdate" }))
        {
            @Html.HiddenFor(m => m.ProjectID, new { @id = "HidProjectID" })
            @Html.HiddenFor(m => m.EditType, new { @id = "HidEditType" })
            @Html.HiddenFor(m => m.FilePath, new { @id = "HidFilePath" })
            <table border="0" cellpadding="0" cellspacing="0" width="98%" class="DialogTable">
                <tr>
                    <td width="70px" align="right">项目名称：</td>
                    <td align="left" style="width:160px;">@Html.TextBoxFor(m => m.ProjectName, new { @style = "width:98%;", @id = "txt_ProjectName" })</td>
                    <td width="70px" align="right">检验类别：</td>
                    <td align="left" style="width:160px;">@Html.TextBoxFor(m => m.ExpeType, new { @style = "width:98%;", @id = "txt_ExpeType" })</td>
                    <td width="70px" align="right">区域：</td>
                    <td align="left">@Html.DropDownListFor(m => m.AreaID, ViewData["AreaList"] as SelectList, new { @id = "Drop_Area" })</td>
                </tr>
                <tr>
                    <td width="70px" align="right">分类：</td>
                    <td align="left">@Html.DropDownListFor(m => m.ProjectTypeID, ViewData["ProjectTypeList"] as SelectList, new { @id = "Drop_ProjectType", @style = "width:98%;" })</td>
                    <td width="70px" align="right">实验室：</td>
                    <td align="left" > @Html.DropDownListFor(m => m.LaboratoryID, ViewData["LaboratoryList"] as SelectList, new { @id = "Drop_Laboratory", @style = "width:98%;" })</td>
                    <td width="70px" align="right">模版文件：</td>
                    <td align="left">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>@Html.TextBoxFor(m => m.FileName, new { @style = "width:120px;", @id = "txt_FileName" })</td>
                                <td colspan="2" align="left">&nbsp;&nbsp;<input type="text" id="uploadify" /></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td width="70px" align="right">农残项目：</td>
                    <td align="left">@Html.DropDownListFor(m => m.IsPesCheck, ViewData["PesCheckList"] as SelectList, new { @id = "Drop_PesCheck", @style = "width:98%;" })</td>
                    <td width="70px" align="right">数据范围：</td>
                    <td colspan="3" align="left">
                    @Html.TextBoxFor(m => m.SampleDataRange, new { @style = "width:100px;", @id = "txt_SampleDataRange" })
                    <span style="color:Red;">注：该范围是指模版检验数据读取范围（例如：B17：I24）</span>
                    </td>
                </tr>
                <tr>
                    <td align="right">检验依据：</td>
                    <td colspan="5" align="center">
                    @Html.TextBoxFor(m => m.ExpeMethod, new { @style = "width:99%;", @id = "txt_ExpeMethod" })
                </tr>
                <tr>
                    <td align="right">检测范围：</td>
                    <td colspan="5" align="center">
                    @Html.TextBoxFor(m => m.ExpRange, new { @style = "width:99%;", @id = "txt_ExpRange" })
                    </td>
                </tr>
                <tr>
                    <td align="right">检验标准：</td>
                    <td colspan="5" align="center">
                    @Html.TextAreaFor(m => m.InsStand, new { @style = "width:100%;height:50px;", @id = "txt_InsStand" })</td>
                </tr>
                <tr>
                    <td align="right">备注：</td>
                    <td colspan="5" align="center">
                    
                    @Html.TextAreaFor(m => m.Remark, new { @style = "width:100%;height:50px;", @id = "txt_Remark" })</td>
                </tr>
                <tr>
                    <td colspan="6" align="center">
                        <a href="javascript:void(0)" onclick="submit()"><img src="~/Content/Images/baocun.png" height="20px" /></a>
                        <a href="javascript:void(0)" onclick="Close()"><img src="~/Content/Images/quxiao.png" height="20px" /></a>
                    </td>
                </tr>
            </table>
        }
        <!--图片上传-->
<script type="text/javascript">
    //提交
    function submit() {
        if (!IsV()) {
            return;
        }
        $('#frmUpdate').submit();
    }


    //验证
    function IsV() {
        var b = true;
        if ($("#txt_SampleDataRange").val().indexOf(':') < 0 && $("#txt_SampleDataRange").val().indexOf('：') < 0) {
            b = false;
            alert("数据范围输入有误！");
        }
        return b;
    }


    /*上传文件控件*/
    $("#uploadify").uploadify({
        'uploader': '@Url.Content("~/Scripts/uploader/uploadify.swf")',
        'script': '@Url.Action("ImportV2", "ShowImage")',
        'cancelImg': '@Url.Content("~/Scripts/uploader/cancel.png")',
        'folder': 'UpFile',
        'queueID': 'fileQueue',
        'auto': false,
        'multi': false,
        'height': 20,
        'width': 75,
        'fileSizeLimit': '10240KB',
        'fileTypeDesc': '文档类型',
        'fileTypeExts': '*.doc;*.pdf;*.jpg;*.png;*.gif;*.bmp;*.*;',
        'buttonImg': '@Url.Content("~/Content/Images/daochuwenjian.png")',
        'onComplete': fun,
        'onSelect': function (e, queueId, fileObj) {
            $('#uploadify').uploadifyUpload();
        },
        'onCancel': function (file) {
        }
    });
    /*结束 上传文件控件*/
    function fun(event, queueID, fileObj, response, data) {
        if (response == "false") {
            alert("文件上传出错！");
        }
        else {
            $('#txt_FileName').val(response.split('|')[0]);
            $('#HidFilePath').val(response.split('|')[1]);
            alert("成功上传！");
        }
    }
    </script>
</body>
